Method for performing data management in memory device, associated memory device and controller thereof

ABSTRACT

A method for performing data management in a memory device includes: receiving a set of data from a host device positioned outside the memory device; encoding the set of data according to a first sub-matrix of a predetermined parity-check matrix to generate a partial parity-check code; performing post-processing upon the partial parity-check code according to a predetermined post-processing matrix to generate a parity-check code of the set of data, where the predetermined post-processing matrix is not equivalent to any inverse matrix of a transpose matrix of a second sub-matrix of the predetermined parity-check matrix; and writing/programming a codeword of the set of data into a non-volatile memory of the memory device to allow the memory device to perform error correction when reading the set of data from the non-volatile memory. An associated memory device and a controller thereof are also provided.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The present invention relates to flash memory access, and moreparticularly, to performing data management in a memory device.

2. Description of the Prior Art

Developments in memory technology have led to the wide application ofportable memory devices, such as memory cards which conform to theSD/MMC, CF, MS and XD specifications, respectively. Improving accesscontrol of memories in these portable memory devices remains an issue tobe solved in the art.

NAND flash memories may comprise single level cell (SLC) and multiplelevel cell (MLC) flash memories. In an SLC flash memory, each transistorused as a memory cell may have any of two electrical charge values,respectively representing the logic values 0 and 1. The storage abilityof each transistor used as a memory cell in an MLC flash memory may befully utilized, where the transistor may be driven by a voltage higherthan that in the SLC flash memory, and different voltage levels can beutilized to record information of at least two bits (e.g. 00, 01, 11, or10). In theory, the recording density of the MLC flash memory may reachat least twice the recording density of the SLC flash memory, and istherefore preferred by manufacturers of NAND flash memories.

Compared with the SLC flash memory, the lower cost and larger capacityof the MLC flash memory means it is more likely to be applied inportable memory devices. The MLC flash memory does have instabilityissues, however. To ensure that access control of the flash memory inthe portable memory device meets related specifications, a controller ofthe flash memory is usually configured to have management mechanisms toproperly manage the access of data.

Related art memory devices with the above management mechanisms stillhave some disadvantages. The error rate of the MLC flash memory may begreatly increased under some circumstances, such that traditional errorcorrection mechanisms are unable to deal with the resultant burst error.Hence, there is a need for a novel memory access design having botherror correction mechanism and data access mechanism.

SUMMARY OF THE INVENTION

An objective of the present invention is to provide a memory device, amethod for performing data management in the memory device, and anassociated controller, in order to solve the problems of the relatedarts.

Another objective of the present invention is to provide a memorydevice, a method for performing data management in the memory device,and an associated controller, which can enhance the performance of thememory device.

At least one embodiment of the present invention provides a method forperforming data management in a memory device. The memory devicecomprises a non-volatile memory, the non-volatile memory comprising atleast one non-volatile memory chip. The method may comprise: receiving aset of data from a host device positioned outside the memory device;encoding the set of data according to a first sub-matrix of apredetermined parity-check matrix to generate a partial parity-checkcode; performing post-processing upon the partial parity-check codeaccording to a predetermined post-processing matrix to generate aparity-check code of the set of data, wherein the predeterminedpost-processing matrix is not equivalent to any inverse matrix of atranspose matrix of a second sub-matrix of the predeterminedparity-check matrix; and writing a codeword of the set of data into anon-volatile memory to allow the memory device to perform errorcorrection when reading the set of data from the non-volatile memory,wherein the codeword comprises the set of data and the parity-checkcode.

In addition to the above method, the present invention also provides amemory device, and the memory device comprises a non-volatile memory anda controller. The non-volatile memory is arranged to store information,wherein the non-volatile memory comprises at least one non-volatilememory chip. The controller is coupled to the non-volatile memory, andthe controller is arranged to perform data management in the memorydevice, wherein: the controller receives a set of data from a hostdevice positioned outside the memory device; the controller encodes theset of data according to a first sub-matrix of a predeterminedparity-check matrix to generate a partial parity-check code; thecontroller performs post-processing upon the partial parity-check codeaccording to a predetermined post-processing matrix to generate aparity-check code of the set of data, wherein the predeterminedpost-processing matrix is not equivalent to any inverse matrix of atranspose matrix of a second sub-matrix of the predeterminedparity-check matrix; and the controller writes a codeword of the set ofdata into the non-volatile memory to allow the memory device to performerror correction when reading the set of data from the non-volatilememory, wherein the codeword comprises the set of data and theparity-check code.

In addition to the above method, the present invention also provides acontroller of a memory device. The memory device comprises thecontroller and a non-volatile memory. The non-volatile memory comprisesat least one non-volatile memory chip, and the controller comprises aprocessing circuit and a data protection circuit. The processing circuitis arranged to control the controller to receive a set of data from ahost device positioned outside the memory device. The data protectioncircuit is coupled to the processing circuit, and is arranged to performerror correction. The data protection circuit encodes the set of dataaccording to a first sub-matrix of a predetermined parity-check matrixto generate a partial parity-check code. The data protection circuitperforms post-processing upon the partial parity-check code according toa predetermined post-processing matrix to generate a parity-check codeof the set of data, wherein the predetermined post-processing matrix isnot equivalent to any inverse matrix of a transpose matrix of a secondsub-matrix of the predetermined parity-check matrix. The processingcircuit controls the controller to write a codeword of the set of datainto the non-volatile memory to allow the memory device to perform errorcorrection when reading the set of data from the non-volatile memory,wherein the codeword comprises the set of data and the parity-checkcode.

By properly performing data management, the present invention mayproperly perform memory access management upon the data accessed by thecontroller, which thereby reduces the error rate. Further, implementingaccording to the embodiments of the present invention will not greatlyraise the cost.

These and other objectives of the present invention will no doubt becomeobvious to those of ordinary skill in the art after reading thefollowing detailed description of the preferred embodiment that isillustrated in the various figures and drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram of a memory device and a host device according to afirst embodiment of the present invention.

FIG. 2A illustrates a local page address linking table in a block of aflash chip.

FIG. 2B compares the one-dimensional array illustration and thetwo-dimensional array illustration of the local page address linkingtable shown in FIG. 2A.

FIG. 3 is a flowchart of a method for performing data management in amemory device according to an embodiment of the present invention.

FIG. 4 illustrates the sizes of related matrices according to anembodiment of the present invention.

FIG. 5 illustrates a coding circuit according to an embodiment of thepresent invention.

DETAILED DESCRIPTION I. The Memory System

FIG. 1 is a diagram of a memory device 100 and a host device 200according to a first embodiment of the present invention. The memorydevice 100 may be a portable memory device (e.g. a memory cardconforming to the SD/MMC, CF, MS or XD specification) or a solid statedrive (SSD). In addition, examples of the host device 200 may comprise(but are not limited to): a multifunctional mobile phone, tablet,wearable device, and a personal computer. According to this embodiment,the memory device 100 may comprise a controller and a non-volatilememory, where the non-volatile memory is arranged to store information,the controller is arranged to access the non-volatile memory, and thenon-volatile memory may comprise at least one non-volatile memory chip(e.g. one or more non-volatile memory chips). The controller may be amemory controller 110, and the non-volatile memory may be a flash memory120. The flash memory 120 may comprise at least one flash memory chip(e.g. one or more flash memory chips), and the memory controller 110 maybe arranged to access the flash memory 120. As shown in FIG. 1, thememory controller 110 may comprise a processing circuit such as amicroprocessor 112, a storage unit (e.g. a read-only memory (ROM)) 112M,a control logic circuit 114, a buffer memory 116, and a transmissioninterface circuit 118, where the above components may be coupled to oneanother via a bus. The buffer memory 116 is implemented by a randomaccess memory (RAM). The read-only memory 112M of this embodiment isarranged to store a program code 112C, and the microprocessor 112 isarranged to execute the program code 112C to control the access of theflash memory 120. Note that, in some examples, the program code 112C maybe stored in the buffer memory 116 or any type of memory. Further, adata protection circuit 114DP in the control logic circuit 114 mayprotect data and/or perform error correction, and the transmissioninterface circuit 118 may conform to a specific communicationsspecification (e.g. the Serial Advanced Technology Attachment (SATA)specification, or Universal Serial Bus (USB)) specification), and mayperform communications according to the specific communicationsspecification.

In this embodiment, the host device 200 may transmit commands andcorresponding logical addresses to the memory controller 110 to accessthe memory device 100. The memory controller 110 receives the commandsand the logical addresses, and controls the flash memory 120 to performreading, writing/programing or erasing upon the memory units havingphysical addresses within the flash memory 120, where the physicaladdresses correspond to the logical addresses.

II. Page Address Linking Table

FIG. 2A illustrates a local page address linking table in a block of aflash chip 0, where the flash chip 0 may be an example of the flashmemory chip mentioned above. As shown in FIG. 2A, the flash chip 0comprises a plurality of blocks 0, 1, 2, . . . , and M. Note that ablock is used as an erasing unit. In other words, when there is a needfor erasing data, the microprocessor 112 may simultaneously erase alldata stored in the block. In addition, a block, such as the block 0shown in FIG. 2A, may comprise a plurality of pages. For example, theblock 0 of the flash chip 0 comprises 128 pages. In the block (such asblock 0), the pages are divided into two areas, where one is a data areafor storing data, and the other is a table area for storing a local pageaddress linking table 0. The pages in the data area of the block may becalled the data pages of the block, where any of the data pages maycomprise a data byte region DBR and a spare byte region SBR.

According to this embodiment, the page count of the data area and thepage count of the table area may be set according to requirements. Forexample, the pages 0, 1, 2, . . . , 126 may be arranged to store data,and the remaining page in the block may be arranged to store the localpage address linking table 0. According to some embodiments, the dataarea may have less than 127 pages, and the table area may comprise twoor more pages. In another example, the respective page counts in theblock, the data area and the table area may vary. Note that one page isa programming/writing unit. In other words, when programming writingdata is required, the microprocessor 112 may program/write a page ofdata into one page. According to this embodiment, each block in theflash memory 120 shown in FIG. 1 may have a local page address linkingtable. For brevity, only the local page address linking table 0 of theblock 0 of the flash chip 0 is illustrated in FIG. 2A since thefunctions and associated operations of the local page address linkingtables of the blocks are similar to each other.

In this embodiment, the creation time of the local page address linkingtable 0 is the time point when all data pages in the block 0 are written(i.e. fully programmed). Before the data page in the block 0 are fullyprogramed, the microprocessor 112 may temporarily store a temporarylocal page address linking table 0 into the random access memory. Whenthe linking relationship between a physical page address and a logicalpage address changes in the block 0, the microprocessor 112 may updatethe temporary local page address linking table 0.

According to this embodiment, the ranking of a field (or entry) in thetemporary/non-temporary local page address linking table (e.g. thetemporary local page address linking table 0 or the local page addresslinking table 0) represents a physical page address, and the content inthis field represents an associated logical page address. Assume thati_(p) and j_(p) are the row number and the column number of theillustrative table location (i_(p), j_(p)) of thetemporary/non-temporary local page address linking table shown in FIG.2A, respectively, where i_(p) may be a non-negative integer (e.g.i_(p)=0, 1, . . . ), and j_(p) may be a non-negative integer (e.g.j_(p)=0, 1, . . . ). In this two-dimensional array illustration of thetemporary/non-temporary local page address linking table shown in FIG.2A, the illustrative table location (i_(p), j_(p)) corresponding to the(i_(p)*4+j_(p))^(th) field represents a physical page address PPN. Thephysical page address PPN can be expressed as follows:

PPN=(PBN*DPC+i _(p)*4+j _(p));

where the parameter PBN represents the physical block number of theabove-discussed physical block (e.g. PBN=0, 1, 2, . . . , correspondingto the blocks 0, 1, 2, . . . , respectively), and the parameter DPCrepresents the data page count of each block (the data page count is 127in this embodiment). This is merely for illustrative purposes, ratherthan a limitation of the present invention. For better comprehension,the temporary/non-temporary local page address linking table may beillustrated with a single column as shown in the right half of FIG. 2B.Given that i_(p) still represents the row number and i_(p)=0, 1, . . . ,in this one-dimensional array illustration shown in the right half ofFIG. 2B, for the temporary/non-temporary local page address linkingtable of the block PBN, the illustrative table location i_(p)corresponding to the i_(p) ^(th) field represents a physical pageaddress (PBN*DPC+i_(p)). That is, for this one-dimensional arrayillustration, the above equation can be rewritten as follows:

PPN=(PBN*DPC+i _(p)).

When the host device 200 transmits a command to the microprocessor 112in order to write some data at a logical page address 0x0002, themicroprocessor 112 may write the data to the data byte region DBR of thepage 0 of the block 0 of the flash chip 0, write the logical pageaddress 0x0002 to the spare byte region SBR of the page 0 of the block 0of the flash chip 0, and also write the logical page address 0x0002 tothe first field of the temporary local page address linking table 0, inorder to indicate that the logical page address 0x0002 is linked/mappedto the page 0 of the block 0 of the flash chip 0, where the physicalpage address thereof is 0x0000. The rest may be deduced by analogy. Inthis way, when all data pages in the block 0 are written, themicroprocessor 112 may copy the latest version of the temporary localpage address linking table 0 in order to create the local page addresslinking table 0. Note that the logical page addresses {0x0002, 0x0001,0x0002, 0x0005, 0x0003, 0x0007, 0x0010, 0x0008, . . . , 0x0000, 0x0009,0x0004} may be taken as an example of the logical addresses. Accordingto some embodiments, the logical addresses may vary.

According to some embodiments, the range of the logical page addressesin a local page address linking table (e.g. the local page addresslinking table 0) may exceed the page count in a block (e.g. the block0).

According to some embodiments, the microprocessor 112 may create aglobal page address linking table in the random access memory accordingto multiple local page address linking tables respectively correspondingto multiple blocks, in order to record/update the relationships betweenthe physical addresses and the logical addresses.

III. Error Correction

The memory controller 110 may perform data management in the memorydevice 100 to properly solve problems in the related arts withoutintroducing unwanted side effects, or in a way that is less likely tointroduce a side effect. For example, the memory controller 110 mayprovide one or more types of error correction mechanisms to the memorydevice 100. According to some embodiments, the memory controller 110 mayutilize a low-density parity-check (LDPC) code to protect data and/orperform error correction.

FIG. 3 is a flowchart of a method 300 for performing data management ina memory device according to an embodiment of the present invention,where the method 300 is applicable to the memory device 100, and isapplicable to the aforementioned controller such as the memorycontroller 110.

In Step 310, under the control of the processing circuit such as themicroprocessor 112, the memory controller 110 may receive a set of datam from the host device 200 positioned outside the memory device 100. Thehost device 200 may transmit a writing command to the memory device 100,to request the memory device 100 to store the associated write data.According to the writing command, the microprocessor 112 may control thememory controller 110 to receive the write data from the host device200, where the write data may comprise at least one set of data (e.g.one or more sets of data) such as a plurality of sets of data {m}, andthe sets of data {m} comprise the set of data m.

In Step 320, the memory controller 110 (e.g. the data protection circuit114DP) may encode the set of data m according to a first sub-matrix H₁of a predetermined parity-check matrix H, in order to generate a partialparity-check code ppc. For example, the data protection circuit 114DPmay encode the one or more sets of data such as the sets of data {m}according to the first sub-matrix H₁ to generate one or more associatedpartial parity-check codes such as a plurality of partial parity-checkcodes {ppc}, respectively, where the partial parity-check codes {ppc}comprise the partial parity-check code ppc.

In Step 330, the memory controller 110 (e.g. the data protection circuit114DP) may perform post-processing upon the partial parity-check codeppc according to a predetermined post-processing matrix J, in order togenerate the parity-check code p of the set of data m, where thepredetermined post-processing matrix J is not equivalent to any inversematrix ((H₂)^(T))⁻¹ of the transpose matrix (H₂)^(T) of a secondsub-matrix H₂ of the predetermined parity-check matrix H, if the inversematrix ((H₂)^(T))⁻¹ mentioned above exists. For example, if the inversematrix ((H₂)^(T))⁻¹ exists, the predetermined post-processing matrix Jis not equivalent to ((H₂)^(T))⁻¹. In another example, when the inversematrix ((H₂)^(T))⁻¹ does not exist, the predetermined post-processingmatrix J will not be any derivative of the transpose matrix (H₂)^(T).For example, the data protection circuit 114DP may performpost-processing upon the one or more partial parity-check code such asthe partial parity-check codes {ppc} according to the predeterminedpost-processing matrix J to generate one or more associated parity-checkcodes such as a plurality of parity-check codes {p} of the sets of data{m}, respectively, where the parity-check codes {p} comprise theparity-check code p.

In Step 340, under the control of the processing circuit such as themicroprocessor 112, the memory controller 110 may write a codeword c ofthe set of data m into the non-volatile memory (e.g. the flash memory120), to allow the memory device 100 to perform error correction whenreading the set of data m from the non-volatile memory, where thecodeword c comprises the set of data m and the parity-check code p. Forexample, the microprocessor 112 may control the memory controller 110 towrite one or more associated codewords such as a plurality of codewords{c} of the write data into the non-volatile memory, to allow the memorydevice 100 to perform error correction when reading the write data fromthe non-volatile memory, where the codewords {c} comprise the sets ofdata {m} and the parity-check codes {p}.

According to some embodiments, the codeword c is equal to themultiplication result of the set of data m and a predetermined codingtransformation matrix G (i.e. m·G=c). Based on a first method forperforming data protection, the controller, such as the memorycontroller 110 (e.g. the data protection circuit 114DP), may perform amultiplication operation upon the set of data m and the predeterminedcoding transformation matrix G (e.g. m·G) to generate the codeword c,and may perform a multiplication operation upon the set of data m and asub-matrix D of the predetermined coding transformation matrix G (e.g.m·D), in order to generate the parity-check code p. For example,G=[I|D], where I is a corresponding identity matrix. According to someembodiments, based on a second method for performing data protection,the controller, such as the memory controller 110 (e.g. the dataprotection circuit 114DP), may generate the parity-check code paccording to the following equation:

p=m·(H ₁)^(T)((H ₂)^(T))⁻¹

Note that the predetermined parity-check matrix H in Step 320 is not thepredetermined coding transformation matrix G, and the predeterminedpost-processing matrix J in Step 330 is not the predetermined codingtransformation matrix G. Based on the method 300 shown in FIG. 3, thedata protection circuit 114DP adopts the first sub-matrix H₁ of thepredetermined parity-check matrix H (rather than the predeterminedcoding transformation matrix G) during generation of the partialparity-check code ppc, and adopts the predetermined post-processingmatrix J (rather than the predetermined coding transformation matrix G)during generation of the parity-check code p. In the embodiment shown inFIG. 3, by performing the post-processing upon the partial parity-checkcode ppc according to the predetermined post-processing matrix J, ratherthan by performing any multiplication operation upon the set of data mand the predetermined coding transformation matrix G, the memorycontroller 110 (e.g. the data protection circuit 114DP) may generate theparity-check code p. In some embodiments, the predetermined codingtransformation matrix G and the predetermined parity-check matrix H arenull space with respect to each other. For example, the set of data mmay comprise k bits and be denoted as the one-dimensional matrix(m)_(1×k), the codeword c may comprise n bits and be denoted as theone-dimensional matrix (c)_(1×n) and the parity-check code p maycomprise (n−k) bits and be denoted as the one-dimensional matrix(p)_(1×(n−k)), where k and n are positive integers and n>k. In addition,the predetermined coding transformation matrix G may be denoted as thetwo-dimensional matrix (G)_(k×n), and the predetermined parity-checkmatrix H may be denoted as the two-dimensional matrix (H)_((n−k)×n).Further, the inner product of any row of the predetermined codingtransformation matrix G and any row of the predetermined parity-checkmatrix H is equal to zero, which can be denoted as G·H^(T)=0 for bettercomprehension. In some embodiments, the set of data m, the codeword cand the parity-check code p may be denoted as the one-dimensional matrix(m)_(1×k), the one-dimensional matrix (c)_(1×n) and the one-dimensionalmatrix (p)_(1× (n−k)), respectively, and the predetermined parity-checkmatrix H may be denoted as the two-dimensional matrix (H)_((n−k)×n). Theinner product of the codeword c and any row of the predeterminedparity-check matrix H is equal to zero; this can be denoted as c·H^(T)=0for better comprehension. According to some embodiments, the secondsub-matrix H₂ may be a non-full rank matrix, where the inverse matrix((H₂)^(T))⁻¹ of the transpose matrix (H₂)^(T) of the second sub-matrixH₂ does not exist.

Compared with the first method and the second method, the method 300shown in FIG. 3 may enhance various performance of the data protectioncircuit 114DP, such as the performance of encoding.

FIG. 4 illustrates the sizes of related matrices according to anembodiment of the present invention. The notations “k” and “n” mayrepresent the bit count of the set of data m and the bit count of thecodeword c, respectively. The bit count of the parity-check code p isequal to the bit count n of the codeword c minus the bit count k of theset of data m; this can be denoted as the difference value (n−k). Inaddition, the size of the predetermined parity-check matrix H is equalto the product of the difference value (n−k) and the bit count n of thecodeword c; this can be denoted as ((n−k)*n). The size of the firstsub-matrix H₁ is equal to the product of the difference value (n−k) andthe bit count k of the set of data m; this can be denoted as ((n−k)*k).The size of the second sub-matrix H₂ is equal to the square of thedifference value (n−k); this can be denoted as ((n−k)*(n−k)).

According to some embodiments, under the control of the processingcircuit such as the microprocessor 112, the memory controller 110 mayread the codeword c from the non-volatile memory (e.g. the flash memory120) in order to generate the readout data of the codeword c. The memorycontroller 110 (e.g. the data protection circuit 114DP) may determinewhether the readout data is correct according to the predeterminedparity-check matrix H. The data protection circuit 114DP may comprise aread-only memory for storing the predetermined parity-check matrix H. Insome examples, the predetermined parity-check matrix H may be stored inthe read-only memory 112M or any of other memories. When the readoutdata is determined to be correct, the memory controller 110 (e.g. theprocessing circuit such as the microprocessor 112) may control thememory device 100 to output the set of data m carried by the readoutdata; otherwise, the data protection circuit 114DP may perform errorcorrection according to the readout data in order to recover the set ofdata m. In response to a read command of the host device 200, themicroprocessor 112 may control the memory device 100 to output the setof data m (e.g. the set of data m carried by the readout data, or theset of data m recovered via the error correction).

FIG. 5 illustrates a coding circuit 500 according to an embodiment ofthe present invention, where the coding circuit 500 may be positioned inthe data protection circuit 114DP shown in FIG. 1. The coding circuit500 may comprise a first sub-matrix generator 510 (which may also bereferred to as the H₁ generator in this embodiment), a multiplicationcircuit 512 and a post-processing circuit 520. The first sub-matrixgenerator 510 may comprise a read-only memory storing the firstsub-matrix H₁. The first sub-matrix generator 510 may output theelements of the first sub-matrix H₁ to the multiplication circuit 512according to a predetermined order. The multiplication circuit 512 mayreceive the set of data m and the first sub-matrix H₁, and may perform amultiplication operation (e.g. m·(H₁)^(T)) in order to generate thepartial parity-check code ppc. For example, ppc=m·(H₁)^(T). Thepost-processing circuit 520 may perform post-processing upon the partialparity-check code ppc according to the predetermined post-processingmatrix J, in order to generate the parity-check code p. Thepost-processing may comprise a multiplication operation (e.g. ppc·J) aswell as follow-up operations. For better comprehension, thepost-processing may be denoted as f(ppc·J), where the symbol f( ) mayrepresent the above-mentioned follow-up operations. According to someembodiments, the architecture shown in FIG. 5 may vary.

According to some embodiments, the architecture shown in FIG. 1 and themethod 300 shown in FIG. 3 may vary. For example, the post-processingmay comprise a randomizing operation, a data protection operationsimilar to that of a redundant array of independent disks (RAID), andany linear transformation, where the post-processing circuit 520 maycomprise the associated sub-circuits such as a randomizer circuit, etc.In addition, the architecture for decoding may be modifiedcorrespondingly.

Those skilled in the art will readily observe that numerousmodifications and alterations of the device and method may be made whileretaining the teachings of the invention. Accordingly, the abovedisclosure should be construed as limited only by the metes and boundsof the appended claims.

What is claimed is:
 1. A method for performing data management in amemory device, the memory device comprising a non-volatile memory, thenon-volatile memory comprising at least one non-volatile memory chip,the method comprising: receiving a set of data from a host devicepositioned outside the memory device; encoding the set of data accordingto a first sub-matrix of a predetermined parity-check matrix, togenerate a partial parity-check code; performing post-processing uponthe partial parity-check code according to a predeterminedpost-processing matrix, to generate a parity-check code of the set ofdata, wherein the predetermined post-processing matrix is not equivalentto any inverse matrix of a transpose matrix of a second sub-matrix ofthe predetermined parity-check matrix; and writing a codeword of the setof data into the non-volatile memory, to allow the memory device toperform error correction when reading the set of data from thenon-volatile memory, wherein the codeword comprises the set of data andthe parity-check code.
 2. The method of claim 1, wherein the host devicetransmits a writing command to the memory device to request the memorydevice to store write data; and the method comprises: receiving thewrite data from the host device according to the writing command,wherein the write data comprises a plurality of sets of data, and theplurality of sets of data comprises the set of data; encoding theplurality of sets of data according to the first sub-matrix to generatea plurality of partial parity-check codes, respectively, wherein theplurality of partial parity-check codes comprises the partialparity-check code; performing the post-processing upon the plurality ofpartial parity-check codes according to the predeterminedpost-processing matrix to generate a plurality of parity-check codes ofthe plurality of sets of data, respectively, wherein the plurality ofparity-check codes comprises the parity-check code; and writing aplurality of codewords of the write data into the non-volatile memory,to allow the memory device to perform error correction when reading thewrite data from the non-volatile memory, wherein the plurality ofcodewords comprises the plurality of sets of data and the plurality ofparity-check codes.
 3. The method of claim 1, wherein the codeword isequal to a multiplication result of the set of data and a predeterminedcoding transformation matrix; and the predetermined parity-check matrixis not the predetermined coding transformation matrix.
 4. The method ofclaim 1, wherein the codeword is equal to a multiplication result of theset of data and a predetermined coding transformation matrix; and thepredetermined post-processing matrix is not the predetermined codingtransformation matrix.
 5. The method of claim 4, further comprising:generating the parity-check code by performing the post-processing uponthe partial parity-check code according to the predeterminedpost-processing matrix, rather than by performing a multiplicationoperation upon the set of data and the predetermined codingtransformation matrix.
 6. The method of claim 1, wherein the codeword isequal to a multiplication result of the set of data and a predeterminedcoding transformation matrix; and an inner product of any row of thepredetermined coding transformation matrix and any row of thepredetermined parity-check matrix is equal to zero.
 7. The method ofclaim 1, wherein an inner product of the codeword and any row of thepredetermined parity-check matrix is equal to zero.
 8. The method ofclaim 1, further comprising: reading the codeword from the non-volatilememory, to generate readout data of the codeword; determining whetherthe readout data is correct according to the predetermined parity-checkmatrix; and when it is determined that the readout data is correct,controlling the memory device to output the set of data carried by thereadout data; otherwise, performing error correction according to thereadout data to recover the set of data.
 9. The method of claim 1,wherein the second sub-matrix is a non-full rank matrix, and the inversematrix of the transpose matrix of the second sub-matrix does not exist.10. The method of claim 1, wherein a bit count of the parity-check codeis equal to a difference value calculated from a bit count of thecodeword minus a bit count of the set of data, and a size of thepredetermined parity-check matrix is equal to a product of thedifference value and the bit count of the codeword.
 11. The method ofclaim 10, wherein when k and n represent the bit count of the set ofdata and the bit count of the codeword, respectively, a bit count of theparity-check code is equal to (n−k), and the size of the predeterminedparity-check matrix is equal to ((n−k)*n), wherein k and n are positiveintegers and n>k.
 12. The method of claim 10, wherein a size of thefirst sub-matrix is equal to a product of the difference value and thebit count of the set of data, and a size of the second sub-matrix isequal to a square value of the difference value.
 13. The method of claim12, wherein when k and n represent the bit count of the set of data andthe bit count of the codeword, respectively, the bit count of theparity-check code is equal to (n−k), and the size of the predeterminedparity-check matrix is equal to ((n−k)*n), wherein k and n are positiveintegers and n>k; and the size of the first sub-matrix is equal to((n−k)*k), and the size of the second sub-matrix is equal to((n−k)*(n−k)).
 14. A memory device, comprising: a non-volatile memory,arranged to store information, wherein the non-volatile memory comprisesat least one non-volatile memory chip; and a controller, coupled to thenon-volatile memory, the controller arranged to perform data managementin the memory device, wherein: the controller receives a set of datafrom a host device positioned outside the memory device; the controllerencodes the set of data according to a first sub-matrix of apredetermined parity-check matrix, to generate a partial parity-checkcode; the controller performs post-processing upon the partialparity-check code according to a predetermined post-processing matrix,to generate a parity-check code of the set of data, wherein thepredetermined post-processing matrix is not equivalent to any inversematrix of a transpose matrix of a second sub-matrix of the predeterminedparity-check matrix; and the controller writes a codeword of the set ofdata into the non-volatile memory, to allow the memory device to performerror correction when reading the set of data from the non-volatilememory, wherein the codeword comprises the set of data and theparity-check code.
 15. The memory device of claim 14, wherein thecodeword is equal to a multiplication result of the set of data and apredetermined coding transformation matrix; and the predeterminedparity-check matrix is not the predetermined coding transformationmatrix.
 16. The memory device of claim 14, wherein the codeword is equalto a multiplication result of the set of data and a predetermined codingtransformation matrix; and the predetermined post-processing matrix isnot the predetermined coding transformation matrix.
 17. The memorydevice of claim 16, wherein the controller generates the parity-checkcode by performing the post-processing upon the partial parity-checkcode according to the predetermined post-processing matrix, rather thanby performing a multiplication operation upon the set of data and thepredetermined coding transformation matrix.
 18. A controller of a memorydevice, the memory device comprising the controller and a non-volatilememory, the non-volatile memory comprising at least one non-volatilememory chip, the controller comprising: a processing circuit, arrangedto control the controller to receive a set of data from a host devicepositioned outside the memory device; and a data protection circuit,coupled to the processing circuit, the data protection circuit arrangedto perform error correction, wherein: the data protection circuitencodes the set of data according to a first sub-matrix of apredetermined parity-check matrix, to generate a partial parity-checkcode; and the data protection circuit performs post-processing upon thepartial parity-check code according to a predetermined post-processingmatrix, to generate a parity-check code of the set of data, wherein thepredetermined post-processing matrix is not equivalent to any inversematrix of a transpose matrix of a second sub-matrix of the predeterminedparity-check matrix; wherein the processing circuit controls thecontroller to write a codeword of the set of data into the non-volatilememory, to allow the memory device to perform error correction whenreading the set of data from the non-volatile memory, wherein thecodeword comprises the set of data and the parity-check code.
 19. Thecontroller of claim 18, wherein the codeword is equal to amultiplication result of the set of data and a predetermined codingtransformation matrix; and the predetermined parity-check matrix is notthe predetermined coding transformation matrix.
 20. The controller ofclaim 18, wherein the codeword is equal to a multiplication result ofthe set of data and a predetermined coding transformation matrix; andthe predetermined post-processing matrix is not the predetermined codingtransformation matrix.